<template>
  <div>
      名字：<input v-model="user.name" type="text">
      年龄：<input v-model="user.age" type="text">
  </div>
</template>

<script>
export default {
    data(){
        return{
            user:{name:'',age:''}
        }
    },
    watch:{
       
        user:{
            handler(newVal,oldVal){
                console.log(newVal,oldVal);
            },
             deep:true,
            immediate:true
        }
    
    }

}
</script>

<style>

</style>